﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Controllayer;
using Modellayer;


namespace WcfLayer
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together.
    public class ServiceBioWCF : IServiceBioWCF
    {
        PersonCtr pCtr;
        ReservationCtr rCtr;
        ShowCtr sCtr;
        ShowRoomCtr srCtr;

        public ServiceBioWCF()
        {
            pCtr = new PersonCtr();
            rCtr = new ReservationCtr();
            sCtr = new ShowCtr();
            srCtr = new ShowRoomCtr();
        }

        public void createCustomer(int phoneNumber, string email, string name, string password)
        {
            pCtr.createCustomer(phoneNumber, email, name, password);
        }

        public void createEmployee(int phoneNumber, string email, string name, string password, string loginId)
        {
            pCtr.createEmployee(phoneNumber, email, name, password, loginId);
        }

        public Person findPerson(int phoneNumber)
        {
            return pCtr.findPerson(phoneNumber);
        }

        public void updatePerson(Person p)
        {
            pCtr.updatePerson(p);
        }

        public void createReservation(Show s, Person p, List<Seat> seats)
        {
            rCtr.createReservation(p, s, seats);
        }

        public void createShow(DateTime showtime, ShowRoom sh, Movie m)
        {
            sCtr.createShow(showtime, sh, m);
        }

        public void lockSeat(Show s, int seatNumber)
        {
            sCtr.lockSeat(s, seatNumber);

        }

        public void unlockSeat(Show s, int seatNumber)
        {
            sCtr.unlockSeat(s, seatNumber);
        }

        public void reserveSeat(Show s, int seatNumber, int reservationsId)
        {
            sCtr.reserveSeat(s, seatNumber, reservationsId);
        }

        public Show findShow(int showId)
        {
            return sCtr.findShow(showId);
        }

        public void createMovie(string title, string movieLength)
        {
            sCtr.createMovie(title, movieLength);
        }

        public void createShowRoom(int numberOfSeats)
        {
            srCtr.createShowRoom(numberOfSeats);
        }

        public void updateShowRoom(int showRoomNumber, int numberOfSeats)
        {
            srCtr.updateShowRoom(showRoomNumber, numberOfSeats);
        }
    }
}
